{% extends "base.html" %}

{% block title %}Distributed Log - Add an Alert{% endblock %}

{% block content %}	
        <h2>Add an Alert</h2>
		<div id="filter">
		An alert will be added for the following filter:
		<br /><br />
		<strong>{{ filter.to_string }}</strong>
		</div>
		<br /><br />
		Every new log message will be checked against this filter. If it matches, it will be posted with the following parameters:
		<br /><br />
		<div id="url_form">
		<form action="/alerts/add" method="post">
			<input type="hidden" name="filter_key" value="{{ filter.key }}" />
			<table>
				<tr>
					<td>URL</td>
					<td colspan="2">
						<input type="text" name="alerturl" id="alerturl" size="100" />
					</td>
				</tr>
				<tr>
					<td>Method</td>
					<td colspan="2">
						<select name="method" id="method">
							<option value="GET">GET</option>
							<option value="POST">POST</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>Authentication</td>
					<td><input type="text" name="auth" id="auth" size="40" /></td>
					<td>Basic HTTP authentication, clear text in the format user:password. Leave blank for none.</td>
				</tr>
				<tr>
					<td>Payload</td>
					<td><textarea name="payload" rows="3" cols="40"></textarea></td>
					<td>
						key=value pairs, each on its own line, e.g. status=hello<br/>
						$field[len] is replaced by <len> chars of the log message field (len is optional)<br/>
						Available fields: $message, $severity, $logger_name, $app_name, $logger_ip
					</td>
				</tr>
			</table>
			<br /><br />
			<input type="submit" value="Add an Alert" />
		</form>
		</div>
		<br /><br />
{% endblock content %}	
